<html>
	<head>
	</head>
	<body>
		<script language="javascript">
			function Human(name, gender, address, phoneNumber) {
				this.name = name;
				this.gender = gender;
				this.address = address;
				this.phoneNumber = phoneNumber;
				
				this.getName = function() {
					document.write("Hi I'am " + this.name + ". ");
				};
				this.getAddress = function() {
					document.write("My address is " + this.address + ". ");
				};
				this.getGender = function() {
					document.write("I am " + this.gender + ". ");
				};
				this.getPhoneNumber = function() {
					document.write("My phone number is: " + this.phoneNumber + ".");
				};
			}
			
			Student.prototype = new Human;
			function Student(name, gender, address, phoneNumber, university, mark) {
				this.name = name;
				this.gender = gender;
				this.address = address;
				this.phoneNumber = phoneNumber;
				this.university = university;
				this.mark = mark;
				
				this.marks = new Array();
				this.marks.push(mark);
				
				this.addMark = function(mark) {
					this.marks.push(mark);
				};
				
				this.countAverageMarks = function() {
					var count = 0;
					for(i = 0; i < this.marks.length; i++) {
						count += this.marks[i];
					}
					var average = count / this.marks.length;
					
					document.write("My average mark is : " + average);
				};
				
				this.removeMark = function(remove) {
					this.remove = remove;
					for(i = 0; i < this.marks.length; i++) {
						if(this.marks[i] == remove) {
							this.marks.splice(i, 1);
						}
					}
				};
			}
			
			Parent.prototype = new Human;
			function Parent(name, gender, address, phoneNumber, children) {
				this.name = name;
				this.gender = gender;
				this.address = address;
				this.phoneNumber = phoneNumber;
				this.children = new Student(children);
				
				this.childrens = new Array();
				childrens.push(children);
				
				this.yellChildren = function(children) {
					document.write(this.name + " yelled " + childrens[0].name);
				};
			}
			
			// thie comment is ... PLEASE REMOVE ME
			var student = new Student("Pesho", "man", "Sofia, Student city", "078123456", "Telerik", 6);
			student.addMark(3);
			student.addMark(5);
			student.addMark(6);
			student.removeMark(6);
			student.getName();
			student.getAddress();
			student.getGender();
			student.getPhoneNumber();
			student.countAverageMarks();
			
			var childrens = new Array(new Student("Gosho", "man", "Sofia", "234121441", "FMI", 3));
			var parent = new Parent("Pencho", "man", "Varna", "099231435", childrens);
			
			parent.yellChildren("Gosho");
			
		</script>
	</body>
</html>